home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / grafik / 3d & render tools / irit / contrib / scripts / phone.irt < prev    next >
Encoding:
Text File  |  1996-07-16  |  3.1 KB  |  102 lines

  1.  
  2. pl = nil();
  3. for ( t = 0, 1 , 200,
  4.       scale1 = (random(0,0.05)+0.5) :
  5.       scale2 = (random(0,0.05)+0.5) :
  6.       scale3 = random(0,0.05) :
  7.       snoc (point( scale1 * cos(t/5),
  8.                    scale2 * sin(t/5),
  9.                    (t/50 - 1)+scale3),
  10.             pl)
  11. );
  12. cable_axis = CINTERP(pl,4,70, PARAM_UNIFORM);
  13. free(pl);
  14. cable_cut = circle (vector(0,0,0),.1);
  15. cable = sweepsrf (cable_cut,
  16.               cable_axis,
  17.           OFF);
  18.  
  19. cable = cable * scale (vector(0.4,0.4,1.0));
  20. free (cable_axis);
  21. free (cable_cut);
  22.  
  23. hand_curve = CBEZIER( list ( ctlpt ( p3, 1.0 , 0.0 , 0.0 , 0.0),
  24.                              ctlpt ( p3, 1.0 , 0.2 , 0.2 , 0.0),
  25.                              ctlpt ( p3, 1.0 , 0.65 , 0.2 , 0.0)));
  26. hand_cut_curve = CBSPLINE ( 3,
  27.                             list (
  28.                             ctlpt(p3,1.0,-0.1080,0.4920,0.0),
  29.                             ctlpt(p3,1.0,-0.424,0.496,0.0),
  30.                             ctlpt(p3,1.0,-0.544,0.384,0.0),
  31.                             ctlpt(p3,1.0,-0.48,0.036,0.0),
  32.                             ctlpt(p3,1.0,-0.312,-0.084,0.0),
  33.                             ctlpt(p3,1.0,0.080,-0.096,0.0),
  34.                             ctlpt(p3,1.0,0.252,0.024,0.0),
  35.                             ctlpt(p3,1.0,0.34,0.384,0.0),
  36.                             ctlpt(p3,1.0,0.22,0.496,0.0),
  37.                             ctlpt(p3,1.0,-0.108,0.4920,0.0)),
  38.                         list (0.0,0.0,0.0,3.0,4.0,5.0,6.0,7.0,
  39.                                   8.0,9.0,12.0,12.0,12.0));
  40. hand_cut_curve = hand_cut_curve * trans(vector(0.102,-0.2,0.0));
  41.  
  42. hand_cut_curve = hand_cut_curve * rotz(-90.0);
  43.  
  44. handle = sweepsrf ( hand_cut_curve,
  45.                     hand_curve, OFF);
  46. free (hand_curve);
  47. free (hand_cut_curve);
  48.  
  49. handle = handle * scale (vector(2.0,1.0,0.7));
  50.  
  51. mic_profile = CBSPLINE (3,
  52.     list( ctlpt (p3,1.0,-0.296,0.64,0.0),
  53.               ctlpt (p3,1.0,-0.020,0.640,0.0),
  54.               ctlpt (p3,1.0,0.164,0.520,0.0),
  55.               ctlpt (p3,1.0,0.240,0.140,0.0),
  56.               ctlpt (p3,1.0,0.236,0.052,0.0),
  57.               ctlpt (p3,1.0,0.236,0.052,0.0),
  58.               ctlpt (p3,1.0,0.180,0.048,0.0),
  59.               ctlpt (p3,1.0,0.180,-0.028,0.0),
  60.               ctlpt (p3,1.0,0.236,-0.028,0.0),
  61.               ctlpt (p3,1.0,0.236,-0.028,0.0),
  62.               ctlpt (p3,1.0,0.280,-0.264,0.0),
  63.               ctlpt (p3,1.0,0.208,-0.352,0.0),
  64.               ctlpt (p3,1.0,0.052,-0.348,0.0),
  65.               ctlpt (p3,1.0,-0.016,-0.272,0.0),
  66.               ctlpt (p3,1.0,-0.296,-0.272,0.0)),
  67.          list(KV_OPEN));
  68. mic_profile = mic_profile * trans(vector(0.296,-0.64,0));
  69. mic_profile = mic_profile * rotx(90.0);
  70.  
  71. mic = SURFREV (mic_profile);
  72. free (mic_profile);
  73. mic = mic * rotx(-90.0);
  74.  
  75.  
  76. mic = mic * trans(vector(-0.1,.25,0.0));
  77.  
  78. resolution = 20;
  79.  
  80. mic = gpolygon(mic,off);
  81. handle = gpolygon(handle,off);
  82.  
  83.  
  84. half_phone = mic ^ handle;
  85. free(mic);
  86. free(handle);
  87. half_phone = half_phone * trans(vector(-1.3,0.0,0.0));
  88.  
  89. second_half =  half_phone * scale (vector(-1.0,1.0,1.0));
  90.  
  91. hand_set = second_half ^ half_phone;
  92. free(second_half);
  93. free(half_phone);
  94. cable = cable * roty(90.0);
  95.  
  96. cable = cable * trans(vector(-4.75,-0.2,0.0));
  97.  
  98. save ("phone",list(hand_set,cable));
  99. interact(list(hand_set,cable));
  100.  
  101.  
  102.